package de.slothsoft.wasbinich.android.control;

import android.widget.TextView;

public class TextViewCountDown extends CountDown {

    private static final long serialVersionUID = 4977874748865492734L;

    private final TextView textView;

    public TextViewCountDown(TextView textView, long millisInFuture, long countDownInterval) {
	super(millisInFuture, countDownInterval);
	this.textView = textView;
	this.textView.setText("" + millisInFuture / 1000); //$NON-NLS-1$
    }

    @Override
    public void onTick(long millisUntilFinished) {
	this.textView.setText("" + millisUntilFinished / 1000); //$NON-NLS-1$
    }

    @Override
    public void onFinish() {
	this.textView.setText("0"); //$NON-NLS-1$
    }
}
